本文整理汇总了C++中Bar类的典型用法代码示例。如果您正苦于以下问题:C++ Bar类的具体用法?C++ Bar怎么用?C++ Bar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main ()
{
Bar b;
b.f ();// { dg-error "no matching" }
b.f (10);
}
示例2: THISBACK
void FormEdit::CreateMenuBar(Bar& bar)
{
bar.Add(t_("File"), THISBACK(FileBar));
bar.Add(t_("Item"), THISBACK(ItemBar));
bar.Add(t_("Form"), THISBACK(FormBar));
bar.Add(t_("View"), THISBACK(ViewBar));
}
示例3: AlignObjectMenu
void FormView::AlignObjectMenu(Bar& bar)
{
bar.Add(t_("Top "), THISBACK(AlignTopSelection));
bar.Add(t_("Left"), THISBACK(AlignLeftSelection));
bar.Add(t_("Right"), THISBACK(AlignRightSelection));
bar.Add(t_("Bottom "), THISBACK(AlignBottomSelection));
}
示例4: QPointF
void NoteEntryAction::renderKeyboardPreview(QPainter& painter, const MusicCursor& cursor)
{
Staff* staff = cursor.staff();
Part* part = staff->part();
Sheet* sheet = part->sheet();
Bar* bar = sheet->bar(cursor.bar());
QPointF p = bar->position() + QPointF(0, staff->top());
Voice* voice = cursor.staff()->part()->voice(cursor.voice());
VoiceBar* vb = voice->bar(bar);
if (cursor.element() >= vb->elementCount()) {
// cursor is past last element in bar, position of cursor is
// halfway between last element and end of bar
if (vb->elementCount() == 0) {
// unless entire voicebar is still empty
p.rx() += 15.0;
} else {
VoiceElement* ve = vb->element(vb->elementCount()-1);
p.rx() += (ve->x() + bar->size()) / 2;
}
} else {
// cursor is on an element, get the position of that element
p.rx() += vb->element(cursor.element())->x();
}
p.ry() += (cursor.staff()->lineCount() - 1)* cursor.staff()->lineSpacing();
p.ry() -= cursor.staff()->lineSpacing() * cursor.line() / 2;
m_tool->shape()->renderer()->renderNote(painter, m_duration < QuarterNote ? QuarterNote : m_duration, p, 0, Qt::magenta);
}
示例5: main
int main( int argc, char **argv )
{
co::BufferCache cache( 10 );
co::LocalNodePtr node = new co::LocalNode;
const uint64_t size = co::OCommand::getSize();
co::BufferPtr buffer = cache.alloc( co::Buffer::getCacheSize( ));
buffer->resize( size );
reinterpret_cast< uint64_t* >( buffer->getData( ))[ 0 ] = size;
co::ICommand command( node, node, buffer, false );
command.setType( co::COMMANDTYPE_NODE );
command.setCommand( co::CMD_NODE_CUSTOM );
Bar bar;
FooBar fooBar;
BarFoo barFoo;
bar.dispatchCommand( command );
fooBar.dispatchCommand( command );
barFoo.dispatchCommand ( command );
TESTINFO( calls == 3, calls );
return EXIT_SUCCESS;
}
示例6: main
int main(int argv, char **args)
{
QApplication app(argv, args);
CodeEditor editor;
editor.setWindowTitle(QObject::tr("Code Editor Example"));
editor.show();
Window w;
w.show();
Foo foo;
foo.doFoo();
Blub b;
b.blubber();
Bar bar;
bar.doBar();
Abc abc;
abc.doAbc();
Xyz xyz;
xyz.doXyz();
Yaf yaf;
yaf.doYaf();
LibC lc;
lc.foo();
return app.exec();
}
示例7: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
Vertex3d* pv3d = new Vertex3d;
Point2d* p2d = pv3d;
p2d->z();
// 子类到第二个基类的指针转换
Vertex* pv = pv3d;
// virtual function的调用
pv->vfun2();
/*
vptr vptr_Vertex = *((vptr*)pv);
(*(vptr + 1))(pv);
*/
_asm
{
mov eax, dword ptr [pv]
mov edx, dword ptr [eax]
mov eax, dword ptr [edx + 4]
call eax
}
// Bar的基类是一个没有virtual function的struct
// 可看出vptr被放在了起始处
Bar* pb = new Bar;
pb->fun();
Foo* pf = pb;
return 0;
}
示例8: main
int main()
{
/* regular cast */
// float d=3.14159265;
// int i = static_cast<int>(d);
// cout << "i = " << i << endl << endl;
for( int n = 0; n < 5; ++n )
{
Base* base = CreateRandom();
base->DoIt();
Bar* bar = static_cast<Bar*>(base);
Foo* foo = static_cast<Foo*>(base);
if( bar )
bar->BarIt();
if( foo )
foo->FooIt();
delete base;
base = NULL;
printf("-------------STATIC_CAST-------------- \n");
}
return 0;
}
示例9: THISBACK
void LayoutDesigner::MainBar(Bar& bar) {
bar.Add("File", THISBACK(FileBar));
bar.Add("Edit", THISBACK(EditBar));
bar.Add("Layout", THISBACK(LayoutBar));
bar.Add("Language", THISBACK(LangBar));
bar.Add("Item", THISBACK(ItemBar));
bar.Add("Options", THISBACK(OptionsBar));
}
示例10: test3
void test3()
{
using namespace AM3359::CONTROL;
Bar bar;
Printf(Con,"#;\n",bar.get_Conf_GPMC_A9());
}
示例11: slotNextRecord
void FuturesDialog::slotNextRecord ()
{
Bar record;
db->getNextBar(currentDate, record);
if (record.getEmptyFlag())
return;
updateFields(record);
}
示例12: GameMenu
void Puzzle::GameMenu(Bar& bar)
{
bar.Add(t_("New game"), THISBACK(New));
bar.Add(t_("Setup.."), THISBACK(Setup));
bar.Add(t_("Best scores.."), THISBACK(Scores));
bar.Separator();
bar.Add(t_("Exit"), Breaker());
}
示例13: PackageMenu
void SelectPackageDlg::PackageMenu(Bar& menu)
{
bool b = GetCurrentName().GetCount();
menu.Add("New package..", THISBACK(OnNew));
menu.Separator();
menu.Add(b, "Rename package..", THISBACK(RenamePackage));
menu.Add(b, "Delete package", THISBACK(DeletePackage));
}
示例14: testAddBar
void testAddBar()
{
Bar* bar = sheet->addBar();
QCOMPARE(bar->sheet(), sheet);
QCOMPARE(sheet->barCount(), 1);
QCOMPARE(sheet->bar(0), bar);
}
示例15: slotFirstRecord
void FuturesDialog::slotFirstRecord ()
{
Bar record;
db->getFirstBar(record);
if (record.getEmptyFlag())
return;
updateFields(record);
}