Commit Graph

1682 Commits

Author SHA1 Message Date
Ray Donnelly
5e61c2dfc7 MinGW-w64 Utils:: compilation fix
The include for utils/environment.h was omitted
unless Q_OS_MSVC, but the code that uses it is
also compiled for MinGW-w64, so change that compile
guard to Q_OS_WIN instead.

Change-Id: I2fa5a09f1864c0ed38d09e3fbb2c6f661fbc8b26
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-06-01 11:38:37 +00:00
BogDan Vatra
28d2b16165 Allow plugins to insert custom imports.
This patch allows a plugin to insert custom imports. These imports are
used by QtC for syntax highlighting and code completion. This way a
plugin can register types and objects that are available only at
runtime.

This is an example of an imports function implementation:

QList<Import> MyPlugin::imports(ValueOwner *valueOwner, const Document
*context) const
{
  // context is needed to know from which project is the opened document
  // in this example we don't care about multiple projects

  Import import;
  import.object = new QmlJS::ObjectValue(valueOwner, "<defaults>");
  import.valid = true;
  const ComponentVersion version(1, 0);
  import.info = ImportInfo::moduleImport("MyPlugin", version,
QString());
  auto myType = valueOwner->newObject(nullptr)
  myType->setMember("myProperty", valueOwner->valueOwner->intValue());
  // add more properties & methods/signals to myType

  import.object->setMember("MyType", myType);

  // in this example we return only one, but you care return more than
one
  return QList<Import>(import);
}

Change-Id: I395c273c7b15a9e4ed5a89a81d70ff92db2b7c0c
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-05-28 06:17:58 +00:00
Ulf Hermann
7b7dddbbc5 Timeline: Adapt test case for behavior change in selection handling
Change-Id: I560cce362964baf9877d5a4833223ca0669b6d0c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-27 12:10:33 +00:00
Ulf Hermann
15300d8c85 Timeline: Test that model height change signals make sense
Change-Id: I561fb90f163f3ee2bd9f8a28e839392f2501c61f
Task-number: QTCREATORBUG-14507
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-27 12:10:25 +00:00
Orgad Shaneh
588b333669 CppTools: Highlight type for templated using
Task-number: QTCREATORBUG-9944
Change-Id: I614571e05039f24b7d56abdddc15f912581f68f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-05-27 08:29:36 +00:00
Orgad Shaneh
d004b1b616 CppTools: Fix test_cppsourceprocessor_macroUses on Windows
It assumes LF line-endings

Change-Id: I7bfeb4b6d4db2fd6457030e2d21c240534de9cd2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-05-27 08:29:22 +00:00
Eike Ziller
3858c33d74 Merge remote-tracking branch 'origin/3.4'
Change-Id: I35ba4cc7f7052699c3006545514c866be3cb5fdd
2015-05-26 15:12:42 +02:00
Orgad Shaneh
81721f6781 C++: Fix resolving of recursive typedef
Use-case:
template<typename _Tp>
struct Temp { typedef _Tp value_type; };

struct Foo { int bar; };

void func()
{
    Temp<Temp<Foo> >::value_type::value_type *p;
    p->bar; // bar not highlighted
}

Task-number: QTCREATORBUG-14237
Change-Id: Ie0b21b81526d610437ed2d2877083bb929c25047
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-05-20 11:14:20 +00:00
Ulf Hermann
aa1b52aec9 Timeline: Use QSGSimpleRectNode for testing render state
Apparently on some Qt versions we cannot add geometry nodes without
material to the tree.

Change-Id: Id6d7debefd2060190f101ab365f27cae2f461d8d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-19 12:38:56 +00:00
Christian Kandeler
de133ee89c Timeline: Fix qbs build.
Change-Id: If28191975c4290eb364e2b2849cf2b9e3daa6c13
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-05-19 08:36:48 +00:00
Ulf Hermann
f356aae5f9 Timeline: Test TimelineZoomControl
Change-Id: I7053848aa5c77228ef2ce760899f411cf35c3c25
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:38:33 +00:00
Ulf Hermann
445c7f0014 Timeline: Test TimelineSelectionRenderPass
Change-Id: Ica6c007dd3f6d1e3d1347b7d805273e63e233483
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:38:29 +00:00
Ulf Hermann
3d09c1411a Timeline: Test TimelineRenderState
Change-Id: Ic89642b6b66f7daf83ba0fa6f74f80ef6af857b7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:38:25 +00:00
Ulf Hermann
a4945a9f01 Timeline: Test TimelineRenderPass
Change-Id: I20cede53c2a61bfd1a8cf216c4e7054d72c0fb3f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:38:22 +00:00
Ulf Hermann
e460c7d1e2 Timeline: Test TimelineRenderer
Change-Id: I0297601767b5660673b92c7f560e57b114a3523d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:38:19 +00:00
Ulf Hermann
b6b8697bef Timeline: Test TimelineOverviewRenderer
Change-Id: I9450f9e260bb11c9e94f7bfe4beb0a9e47ad3ca7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:38:14 +00:00
Ulf Hermann
2ce83b5193 Timeline: Test TimelineNotesRenderPass
Change-Id: If4778e6cc661c76278a13a61f742e8bb0c2d2dad
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:34:14 +00:00
Ulf Hermann
dad60dfca5 Timeline: Extract common test code into separate files
Change-Id: I812c9343a73f8027a02d4e5670a9751c8b8790c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:34:10 +00:00
Ulf Hermann
de7caa70d1 Timeline: Test TimelineNotesModel
Change-Id: Ic29538d4e6f432a504f076665eb489100592d931
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 12:34:02 +00:00
Ulf Hermann
70e8015fa7 Timeline: Move clearing of dirty flags into TimelineAbstractRenderer
As TimelineAbstractRenderer sets the flags it should also clear them.

Change-Id: I78245a9d9048ed50cd0819cc48d22bed89531883
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 11:17:49 +00:00
Ulf Hermann
94b42da80a Timeline: Make 0-width events visible again.
Events with duration == 0 were erroneously filtered out by the items
render pass. Also, we have to give them a very small width in order for
the "stretching" mechanism in the vertex shader to work.

Change-Id: Icb76168f0831547a3ca55ab79df7161736ed4dc4
Task-number: QTCREATORBUG-14446
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-05-18 08:20:43 +00:00
Orgad Shaneh
372173331c C++: Fix explicit typedef from base type in templated class
Use-case:

struct Foo { int bar; };

template<typename T>
struct Base { typedef T F; };

template<typename T>
struct Derived : Base<T>
{
    typedef typename Base<T>::F F;
    F f;
};

void func()
{
    Derived<Foo> d;
    d.f.bar; // bar not highlighted
}

Task-number: QTCREATORBUG-14218
Change-Id: Ic0b22b2f8adf80ff88a2f8b7359c276a744f89e8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-05-15 14:22:10 +00:00
Orgad Shaneh
9b30795c02 C++: Fix lookup for instantiation by class object
Task-number: QTCREATORBUG-14352
Change-Id: I2ce4bc1d0dba2414afe050e80607b581686081a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-05-15 14:21:45 +00:00
Orgad Shaneh
33d270976e C++: Fix highlighting of member on indirect specialization typedef
Missed a spot in ad4cb444fb

Task-number: QTCREATORBUG-14141
Change-Id: I1a6a25ce3e9c2a680e1b8eebec01a17749cdb026
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-05-05 08:59:28 +00:00
Christian Kandeler
271794fbc9 Remove some superfluous QT_VERSION_CHECKs.
5.4.0 is required these days.

Change-Id: I0dc4c788b058f4c3fd2b9026fd7d6c7ab2840884
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-04-30 10:20:45 +00:00
Orgad Shaneh
6a9bd957cb C++: Fix instantiation of typedefed type in block
Use-case:
template<typename T>
struct Temp { T t; };

struct Foo { int bar; };

void func()
{
    typedef Foo *pointer;
    Temp<pointer> temp;
    temp.t->bar; // bar not highlighted
}

Task-number: QTCREATORBUG-14351
Change-Id: I13ca6145a0069bbc7a7207f69b43011c69ec72c7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-28 13:54:40 +00:00
Orgad Shaneh
ad4cb444fb C++: Fix specialization resolution for nested types
Use-cases:

template<typename T>
struct Traits { typedef typename T::pointer pointer; };

template<typename _Tp>
struct Traits<_Tp*> { typedef _Tp *pointer; };

struct Foo { int bar; };

// 1
template<typename T>
class Temp
{
protected:
   typedef Traits<T> TraitsT;

public:
   typedef typename TraitsT::pointer pointer;
   pointer p;
};

void func()
{
   Temp<Foo *> t;
   t.p-> // complete
}

// 2
class Temp2
{
protected:
   typedef Foo *FooPtr;
   typedef Traits<FooPtr> TraitsT;

public:
   typedef typename TraitsT::pointer pointer;
   pointer p;
};

void func2()
{
   Temp2 t;
   t.p-> // complete
}

Task-number: QTCREATORBUG-14141
Change-Id: Id3459671117c0c81bcde7c9714b42750634c0225
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-28 13:54:25 +00:00
Orgad Shaneh
8a84a7305e C++: Add failing template-related tests to CheckSymbols
Runs much faster than plugin tests.

Change-Id: Ie90d10c7d88b63f36bc00077af67d67e24cb4c50
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-23 08:18:44 +00:00
Eike Ziller
6c2c505228 Merge remote-tracking branch 'origin/3.4' 2015-04-23 09:39:09 +02:00
Nikita Baryshnikov
f32eb69a3e TreeModel.test compile fix
for 2b19081cb0

Change-Id: I0b93014602a8a960d9357017bf3b3b096aa2b37c
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-04-22 16:10:01 +00:00
hjk
2b19081cb0 TreeModel: More API cleanup
- introduce topLevelItemCount (similar to QTreeWidget)
- squash untypedTreeLevelItems()
- rename removeItems() to clear()
- rename removeItem() to takeItem()
- rename treeLevelItems<> to itemsAtLevel<>

Change-Id: I0f1bb4110f7687b20da3d92e3d943858645a9fa2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-22 13:48:18 +00:00
kai666_73
b30b69bbf3 C++: Find template member access in find usages
Example:
struct Foo {};
struct Bar {
  template <typename T>
  T *templateFunc() { return 0; }
};
struct Test {
  Bar member;
  void testFunc();
};
void Test::testFunc() {
  member.templateFunc<Foo>();   // "templateFunc" and "Foo" outside of FindUsages
}

Change-Id: I0c5109d00c67054fe15b3fb98cf8cbca69123d8b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-22 13:17:15 +00:00
Orgad Shaneh
13e3c9bc03 C++: Cleanup long CheckSymbols test
Change-Id: I2d1d75d150e4072e649f77e6e46c9a3256f3194b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-22 11:47:08 +00:00
Orgad Shaneh
cb350bfeb2 C++: Rename ClassOrNamespace -> LookupScope
Change-Id: Ide74482b133dd1fec40a725d9aa81bd749385f37
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 14:51:56 +00:00
Orgad Shaneh
29ac9fc65f C++: Remove DeprecatedGenTemplateInstance
It's, well, deprecated...

Change-Id: Ie9d7e80345a8d9404f702dd877b3e940a1a49d93
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 13:37:35 +00:00
hjk
7d13400041 Debugger: Remove StdStream dumper test
This was testing a bool value, not a stream, and doing that wrong
on Windows.

Change-Id: I86b1aaea99e77b2aa3c37bb5c9c3e0ba8a90cb05
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-17 08:25:14 +00:00
Ulf Hermann
171d16c6fb Timeline: Be more exact about height of model aggregator
Only emit the change signal if the height has actually changed.

Change-Id: Ic4bf67f25cb4a7f204815b4e6b0c6bd88c71944a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-04-16 13:33:03 +00:00
Ulf Hermann
7b1a421fbf Timeline: Test TimelineModelAggregator
Change-Id: I327a12212f6e0d842ed2c230a4d489a3178033d0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-04-16 13:32:43 +00:00
Ulf Hermann
8425e198c1 Timeline: Be more exact about model height changes.
Emit the signal every time the height changes, but not if it doesn't.

Change-Id: I3a3da737bc99ae99ac6d5690c55c21d94cf5b647
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-04-16 13:03:25 +00:00
Eike Ziller
37fb296e72 FileSearch: Move FileIterator to std iterator semantics.
We need this when we want to use QtConcurrent::mappedReduced.

Change-Id: I4a6a31f4a0cc9a739a263cc148a1d51d7aa5d418
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-04-16 08:36:13 +00:00
hjk
ba947fbb9e Debugger: Fix handling of ? in dumper test
Normally, we use '?' as an optional Qt namespace qualification.
This clashes with the use of ? in a regexp type expression.
Re-order checks to avoid the clash.

Change-Id: I4a8aee0174f4f3d21bec624919856623808becb1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-16 07:42:34 +00:00
Eike Ziller
50fe3585a8 Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/libs/timeline/qml/MainView.qml
	src/plugins/git/gitclient.cpp

Change-Id: I0b6ec7b9a592014deb0dd2e1145b19dd6753b1c3
2015-04-15 17:45:47 +02:00
hjk
d3c06c9e4a Debugger: Make QUrl dumper test pass for LLDB on Linux
... by relaxing the namespace checks.

Change-Id: I2c2978fe4e95bdc87df24fd6ecbcba4bf1913df3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 13:49:59 +00:00
hjk
7007bf4057 Debugger: Use a more generic approach to LLDB's namespace problem
This is a generalization of 134234be67. '?QFoo' is now meant to
match both 'QFoo' or 'Ns::QFoo' in a namespaced Qt. '@QFoo'
continues to match 'Ns::QFoo' only.

Change-Id: I4285cd9f75a2e4cd94ec5dbb107214f75a60c810
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 13:39:48 +00:00
hjk
aee5668b62 Debugger: Handle char const* and const char* the same in types
Helps recognition of default std::maps and makes the StdMapQt
dumper test pass with LLDB on Linux

Change-Id: I2d2a91d65e895c7fc2c99e24cc77d21ca6353b22
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 12:59:12 +00:00
Christian Stenger
62941c7b87 Tests: Fix parsing of gcc version on SuSE
Change-Id: Ieb8b5a1ea998abbd2d3baf13829f81f9d4cc43e5
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-04-15 11:58:35 +00:00
hjk
6965fc30b1 Debugger: Disable parts of QDate* dumper for GDB on 32 bit
Older versions of GDB (~GDB 7.4 on 32 bit) will cause segmentation
faults in inferior calls due to misaligned %ebx values in an SSE
call in qstring.cpp:findChar.

Change-Id: I44492106080f12e645f9d57828438ec70fd66ca6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 11:07:30 +00:00
Christian Stenger
ff81a1a754 Test: Dumper: Limit single check to Qt5.x
Change-Id: Ia769c16761a171e3e472144cd3ace3280ae5a6aa
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-04-15 08:58:44 +00:00
hjk
32aff7820f Debugger: Make QThread dumper test compile and pass on Mac
Change-Id: I094d3add58681cbc94a76cdc0d45040c705169e5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 08:11:50 +00:00
hjk
8c7d3c3a90 Debugger: Weaken QVariant(QUrl) test
... to make it pass with LLDB. The exact display of the private
is not *that* interesting anyways.

Change-Id: I2d0a8bdd5daff4b03c77b00c887837c7568ea508
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 07:46:20 +00:00